<template>
  <div class="love-video">
    <div class="video-header">
      <h3>我收藏的视频</h3>
      <div class="video-count">共 {{ videos.length }} 个</div>
    </div>
    <div class="video-grid">
      <div v-for="video in videos" :key="video.id" class="video-item">
        <div class="video-thumbnail">
          <img :src="video.thumbnail" :alt="video.title" />
          <div class="video-duration">{{ video.duration }}</div>
          <div class="play-icon">▶</div>
        </div>
        <div class="video-info">
          <div class="video-title">{{ video.title }}</div>
          <div class="video-artist">{{ video.artist }}</div>
          <div class="video-stats">
            <span class="view-count">{{ video.viewCount }} 次播放</span>
            <span class="upload-date">{{ video.uploadDate }}</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref, type Ref } from 'vue'

interface Video {
  id: number
  title: string
  artist: string
  duration: string
  viewCount: string
  uploadDate: string
  thumbnail: string
}

const videos: Ref<Video[]> = ref([
  { 
    id: 1, 
    title: '示例MV1', 
    artist: '示例歌手1', 
    duration: '4:32', 
    viewCount: '125万', 
    uploadDate: '2024-01-15',
    thumbnail: '/placeholder-video.jpg'
  },
  { 
    id: 2, 
    title: '示例MV2', 
    artist: '示例歌手2', 
    duration: '3:45', 
    viewCount: '89万', 
    uploadDate: '2024-02-20',
    thumbnail: '/placeholder-video.jpg'
  },
  { 
    id: 3, 
    title: '示例MV3', 
    artist: '示例歌手3', 
    duration: '5:12', 
    viewCount: '67万', 
    uploadDate: '2024-03-10',
    thumbnail: '/placeholder-video.jpg'
  }
])
</script>

<style scoped>
.love-video {
  padding: 20px 0;
}

.video-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #333;
}

.video-header h3 {
  color: #ffffff;
  margin: 0;
  font-size: 18px;
}

.video-count {
  color: #999;
  font-size: 14px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.video-item {
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  transition: background-color 0.3s ease;
  cursor: pointer;
}

.video-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.video-thumbnail {
  width: 100%;
  aspect-ratio: 16/9;
  position: relative;
  overflow: hidden;
}

.video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-color: #333;
}

.video-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background-color: rgba(0, 0, 0, 0.8);
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #333;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-item:hover .play-icon {
  opacity: 1;
}

.video-info {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.video-title {
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
}

.video-artist {
  color: #999;
  font-size: 14px;
}

.video-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #666;
}

.view-count {
  color: #666;
}

.upload-date {
  color: #666;
}
</style>